package com.run2code.design.behavioral.responsibilitychain;

import java.util.Date;

/**
 * 链路：一级审核
 * 大于等于21号，才需要一级审核
 * 关注公众号【奔跑的码畜】，一起进步不迷路
 *
 * @author 第七人格
 * @date 2024/01/02
 */
public class Level1Chain extends AuditChain {

    public Level1Chain(String auditorId, String auditorName) {
        super(auditorId, auditorName);
    }

    public void audit(String orderId, Date auditDate) {
        if (21 <= AuditChain.getDayOfMonth(auditDate)) {
            System.out.println("====>一级负责人：" + auditorName + " 审核通过");
        }
        AuditChain next = super.next();
        if (next == null) {
            System.out.println("====>未找到下级审核人，流程结束");
        } else {
            next.audit(orderId, auditDate);
        }
    }

}
